﻿package blob.characters
{
    import org.flixel.*;

    public class LargeCharacter extends Character
    {
        private var blobLargeImg:Class;

        public function LargeCharacter(param1:Number, param2:Number)
        {
            this.blobLargeImg = LargeCharacter_blobLargeImg;
            super(param1, param2);
            loadGraphic(this.blobLargeImg, true, true, 120, 120);
            addAnimation("walk", [4, 1, 2, 3], 4, true);
            addAnimation("idle", [0, 5], 2, true);
            addAnimation("jump", [3, 1], 2, false);
            _moveSpeed = 200;
            _jumpPower = 300;
            width = 70;
            offset.x = 15;
            return;
        }// end function

        override public function split() : Array
        {
            var _loc_1:* = new Array();
            var _loc_2:* = new SmallCharacter(x, y);
            _loc_2.y = y + height - _loc_2.height;
            var _loc_3:* = new MediumCharacter(x + width / 2, y);
            _loc_3.y = y + height - _loc_3.height;
            _loc_1.push(_loc_2, _loc_3);
            this.kill();
            return _loc_1;
        }// end function

        override public function size() : int
        {
            return 3;
        }// end function

        override public function update() : void
        {
            if (facing == RIGHT)
            {
                offset.x = 30;
            }
            else
            {
                offset.x = 10;
            }
            if (velocity.x != 0 && isTouching(FlxObject.DOWN))
            {
                play("walk");
            }
            else if (!isTouching(FlxObject.DOWN))
            {
                play("jump");
            }
            else
            {
                play("idle");
            }
            super.update();
            return;
        }// end function

    }
}
